---
title: "Quickstart notebook"
description: "Launch a hosted Colab or Codespace that runs the Agent Optimizer end-to-end."
---

Prefer running in the browser? This guide links to maintained notebooks plus the minimal steps needed to duplicate them in your workspace.

<Callout>
  If you are looking for the general Opik tracing notebook, use the [platform Quickstart notebook](/cookbook/quickstart_notebook). The notebook on this page already includes the Agent Optimizer SDK and walks through datasets/metrics geared toward optimization.
</Callout>

## Choose a platform

| Platform | Launch |
| --- | --- |
| **Google Colab (recommended)** | [<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab" style="vertical-align: middle; display: inline-block;"/>](https://colab.research.google.com/github/comet-ml/opik/blob/main/sdks/opik_optimizer/notebooks/OpikOptimizerIntro.ipynb) |
| **GitHub Codespaces** | [<img src="https://github.com/codespaces/badge.svg" alt="Open in GitHub Codespaces" style="vertical-align: middle; display: inline-block;"/>](https://github.com/codespaces/new?repo=comet-ml/opik&ref=main&machine=basicLinux32gb&devcontainer_path=.devcontainer%2Fopik_optimizer%2Fdevcontainer.json&location=EastUs) |
| **Deepnote** | [<img src="https://deepnote.com/buttons/launch-in-deepnote.svg" alt="Open in Deepnote" style="vertical-align: middle; display: inline-block;"/>](https://deepnote.com/launch?url=https://github.com/comet-ml/opik/blob/main/sdks/opik_optimizer/notebooks/OpikOptimizerIntro.ipynb) |

<Info>
  Every hosted environment still needs your Opik API key. The first notebook cell runs `opik configure` and stores the key only for that runtime session.
</Info>

## Notebook structure

<AccordionGroup>
  <Accordion title="1. Install dependencies">
    Installs `opik`, `opik-optimizer`, `litellm`, and any integration-specific extras.
  </Accordion>
  <Accordion title="2. Configure credentials">
    Prompts for the Opik API key and any model provider tokens (OpenAI, Anthropic, etc.). Nothing is persisted outside the notebook session.
  </Accordion>
  <Accordion title="3. Load datasets">
    Demonstrates both `client.get_or_create_dataset` and uploading CSV/Parquet files stored in the repo.
  </Accordion>
  <Accordion title="4. Define metrics">
    Walks through defining `ScoreResult` metrics and composing them into `MultiMetricObjective` instances.
  </Accordion>
  <Accordion title="5. Run optimizers">
    Runs MetaPrompt and Few-Shot Bayesian optimizers side-by-side so you can compare strategies.
  </Accordion>
  <Accordion title="6. Review results">
    Shows how to call `result.display()` and link out to the Opik dashboard run for deeper analysis.
  </Accordion>
</AccordionGroup>

## Customize the notebook

<Steps>
  <Step title="Swap the dataset">
    Replace the provided HotPotQA subset with your own data by uploading a file or pointing to an existing Opik dataset name.
  </Step>
  <Step title="Change the optimizer or model">
    Update the optimizer class, LLM model, and `model_parameters` to mirror your production stack.
  </Step>
  <Step title="Export results">
    The final cells show how to save optimized prompts and metrics into JSON so you can check them into your repo.
  </Step>
</Steps>

## Next steps

- Need an offline, scriptable flow? Follow the [Quickstart CLI guide](/agent_optimization/getting_started/quickstart).
- Ready to dive into dataset design? Read [Define datasets](/agent_optimization/optimization/define_datasets).
- For integration-heavy workflows, jump to [Optimize agents](/agent_optimization/optimization/optimize_agents).
